package com.lzc.ai.model.vo;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.ai.chat.messages.Message;

/**
 * @Author lizhichuan
 * @Date: 2025/6/3 10:57
 * @Version: v1.0
 */
@NoArgsConstructor
@Data
public class MessageVO {

    private String role;
    private String content;

    public MessageVO(Message message) {
        this.role = switch (message.getMessageType()) {
            case USER -> "user";
            case ASSISTANT -> "assistant";
            case SYSTEM -> "system";
            default -> "";
        };
        this.content = message.getText();
    }

}
